/* ============================================
   Village Portal - Contact Page CSS
   Complete styling for contact.html
   ============================================ */

:root {
  --color-primary: #0052CC;
  --color-primary-dark: #003d99;
  --color-primary-light: #4F8CFF;
  --color-secondary: #22223b;
  --color-text: #22223b;
  --color-text-light: #4b5563;
  --color-placeholder: #999;
  --color-border: #ddd;
  --color-error: #d32f2f;
  --color-success: #10b981;
  --color-bg-light: #f8f8f8;
  --color-white: #ffffff;
  --color-accent: #e0e7ff;
  --font-main: Arial, 'Helvetica Neue', sans-serif;
  --radius: 4px;
  --transition: 150ms ease;
}

/* ============================================
   Reset & Base Styles
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-white);
  margin-left: 250px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary-dark);
}

/* ============================================
   Header & Navigation
   ============================================ */

.portal-header {
  background: linear-gradient(135deg, #1a5490 0%, #0052CC 100%);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  flex-wrap: wrap;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--color-white);
  flex-shrink: 0;
  min-width: 0;
}

.logo-img {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 5px;
}

.logo-text h1,
.portal-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  color: var(--color-white);
}

.portal-tagline {
  font-size: 0.8rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
}

.portal-nav {
  position: fixed;
  left: 0;
  top: 0;
  width: 250px;
  height: 100vh;
  background: linear-gradient(135deg, #1a5490 0%, #0052CC 100%);
  padding: 2rem 0;
  z-index: 101;
  overflow-y: auto;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nav-link {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  padding: 1rem 1.5rem;
  border-radius: 0;
  transition: all var(--transition);
  display: block;
  border-left: 4px solid transparent;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-white);
  border-left: 4px solid var(--color-white);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.mobile-menu-btn span {
  width: 25px;
  height: 3px;
  background: var(--color-white);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ============================================
   Page Section Management
   ============================================ */

.page-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================
   Page Header Styles
   ============================================ */

.page-header {
  background: linear-gradient(135deg, #e3f2fd 0%, #f0f7ff 100%);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #cce0f5;
}

.page-header-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-icon {
  font-size: 1.3rem;
  color: var(--color-primary);
}

.page-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0;
}

.contact-count {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.page-subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   Contact Container & Layout
   ============================================ */

.contact-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ============================================
   Points of Contact Grid
   ============================================ */

.points-of-contact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.contact-person-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--color-white);
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-color var(--transition), transform 0.3s ease;
  cursor: pointer;
}

.contact-person-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.person-avatar {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-primary);
}

.person-avatar svg {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
}

.person-details {
  flex: 1;
  min-width: 0;
}

.person-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 0.35rem 0;
}

.person-role {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  flex-shrink: 0;
}

.person-role span:last-child {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.person-contact {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-icon {
  font-size: 0.9rem;
  color: var(--color-primary);
  width: 18px;
  text-align: center;
}

.contact-item a {
  font-size: 0.85rem;
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-item a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.section-title {
  color: var(--color-secondary);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-primary);
}

/* ============================================
   Footer Styles
   ============================================ */

.portal-footer {
  background: linear-gradient(135deg, #1a5490 0%, #0052CC 100%);
  color: var(--color-white);
  padding: 2rem 1rem;
  margin-top: 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-section h3,
.footer-section h4 {
  margin-bottom: 1rem;
  font-weight: 600;
}

.footer-title {
  font-size: 1.2rem;
}

.footer-text {
  opacity: 0.9;
  margin-bottom: 0.5rem;
}

.footer-desc {
  opacity: 0.8;
  font-size: 0.85rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin: 0.4rem 0;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color var(--transition);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--color-white);
}

.footer-section p {
  margin: 0.4rem 0;
  opacity: 0.9;
  font-size: 0.9rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-bottom p {
  opacity: 0.8;
  font-size: 0.85rem;
}

/* ============================================
   Search & Filter Section
   ============================================ */

.search-section {
  padding: 1rem 2rem;
  background: var(--color-bg-light);
  border-bottom: 1px solid var(--color-border);
}

.search-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 250px;
  max-width: 400px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.6;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: 25px;
  font-size: 0.95rem;
  transition: all var(--transition);
  background: var(--color-white);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-white);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--color-text-light);
}

.filter-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.filter-btn.active {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

/* ============================================
   Enhanced Contact Cards
   ============================================ */

/* NOTE: Base styles are defined above at line 251 */
/* This section adds additional enhancements */

.avatar-initials {
  font-size: 1.2rem;
  letter-spacing: 1px;
  color: white;
  font-weight: 600;
}

.person-department {
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-top: 0.25rem;
  padding: 0.2rem 0.5rem;
  background: var(--color-accent);
  border-radius: 10px;
  display: inline-block;
}

.status-dot.available {
  background: var(--color-success);
  box-shadow: 0 0 5px var(--color-success);
}

.status-dot.busy {
  background: var(--color-error);
  box-shadow: 0 0 5px var(--color-error);
}

.contact-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.action-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.call-btn {
  background: var(--color-success);
  color: white;
}

.call-btn:hover {
  background: #0d9668;
  transform: scale(1.02);
}

.email-btn {
  background: var(--color-primary);
  color: white;
}

.email-btn:hover {
  background: var(--color-primary-dark);
  transform: scale(1.02);
}

/* Ripple effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 82, 204, 0.2);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* No results */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--color-text-light);
}

.no-results-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Nav overlay for mobile */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile menu button animation */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
  z-index: 110;
}

.mobile-menu-btn span {
  width: 25px;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 992px) {
  .points-of-contact {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-container {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input-wrapper {
    max-width: 100%;
  }

  .filter-buttons {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  body {
    margin-left: 0;
  }

  .portal-header {
    padding: 0.75rem 1rem;
  }

  .portal-title {
    font-size: 1.1rem;
  }

  .portal-tagline {
    font-size: 0.7rem;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .portal-nav {
    position: fixed;
    left: -100%;
    top: 0;
    width: 80%;
    max-width: 280px;
    height: 100vh;
    transition: left 0.3s ease;
  }

  .portal-nav.active {
    left: 0;
  }

  .search-section {
    padding: 1rem;
  }

  .filter-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .page-header {
    padding: 1rem;
  }

  .page-title {
    font-size: 1.1rem;
  }

  .contact-container {
    padding: 1.5rem 1rem;
  }

  .points-of-contact {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .contact-person-card {
    padding: 1rem;
  }

  .person-avatar {
    width: 45px;
    height: 45px;
  }

  .person-avatar svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 480px) {
  .page-header-content {
    flex-wrap: wrap;
  }

  .person-name {
    font-size: 0.95rem;
  }

  .contact-item a {
    font-size: 0.8rem;
  }

  .contact-actions {
    flex-direction: column;
  }

  .action-btn {
    width: 100%;
  }

  .filter-buttons {
    width: 100%;
    justify-content: space-between;
  }

  .filter-btn {
    flex: 1;
    text-align: center;
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}
